package com.godpaper.as9.util
{
    import mx.controls.TextInput;
    import mx.validators.StringValidator;
    import mx.validators.ValidationResult;

//[ResourceBundle("validation")]

    public class RePasswordValidator extends StringValidator 
    {
    	

        // Define Array for the return value of doValidation().
        private var results:Array;
		public var orderText:TextInput;
		
		public function setOrderText(orderText:TextInput):void{
        	orderText = orderText;
        }
        public function getOrderText():TextInput{
        	return orderText;
        }
        // Constructor.
        public function RePasswordValidator() 
        {
            // Call base class constructor. 
            super();
            
            
        }
    
        // Define the doValidation() method.
        override protected function doValidation(value:Object):Array 
        {        	
       		 results=new Array();
        	 results=super.doValidation(value);
        	 
       		 if(orderText.text.toString()!=value.toString())
       		 {
       		 	results.push( new ValidationResult(true, null, "notMatch", "password retyped not match!" ));                   
       		 }
       		return results;            
        }
    }
}

